package com.bell.atensettings;

import com.bell.atensettings.settingDetails.EthernetSettings;
import com.bell.atensettings.settingDetails.WifiSettings;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

public class NetWorkSettings extends Activity implements OnItemClickListener
{
    private TextView mTitleView;
    private ListView mListView;
    @Override
    protected void onCreate(Bundle arg0)
    {
        super.onCreate(arg0);
        setContentView(R.layout.public_settings);

        mTitleView = (TextView) findViewById(R.id.setting_title);
        mListView = (ListView) findViewById(R.id.listview);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_subject_item, R.id.tv_data,
                getResources().getStringArray(R.array.network_items));

        mTitleView.setText(getIntent().getStringExtra("title"));
        mListView.setAdapter(adapter);
        mListView.setOnItemClickListener(this);
    }
    
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long arg3)
    {
        Intent intent = null;
        switch (position)
        {
            case 0:
                intent = new Intent(this, WifiSettings.class);
                startActivity(intent);
                break;
            case 1:
                intent = new Intent(this, EthernetSettings.class);
                startActivity(intent);
                break;

            default:
                break;
        }
        overridePendingTransition(R.anim.push_left_in, R.anim.end);
    }
    
}
